home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / Processes.p < prev    next >
Encoding:
Text File  |  1991-04-05  |  4.8 KB  |  190 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {}
  4. {Created: Sunday, January 6, 1991 at 10:58 PM}
  5. {    Processes.p}
  6. {    Pascal Interface to the Macintosh Libraries}
  7. {}
  8. {        Copyright Apple Computer, Inc.    1989-1990}
  9. {        All rights reserved}
  10. {}
  11.  
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes := 0}
  15. {$ENDC}
  16.  
  17.  
  18. unit Processes;
  19. interface
  20.     uses
  21.         Types, OSUtils, QuickDraw, Events, Files;
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.     type
  42. { type for unique process identifier }
  43.         ProcessSerialNumberPtr = ^ProcessSerialNumber;
  44.         ProcessSerialNumber = record
  45.                 highLongOfPSN: LONGINT;
  46.                 lowLongOfPSN: LONGINT;
  47.             end;
  48.  
  49.  
  50.     const
  51.  
  52. {************************************************************************}
  53. { *                            Process identifier.}
  54. { ************************************************************************}
  55. { Various reserved process serial numbers.}
  56.  
  57.         kNoProcess = 0;
  58.         kSystemProcess = 1;
  59.         kCurrentProcess = 2;
  60.  
  61.     type
  62. {*********************************************************************************************************************************************}
  63. { *        Definition of the parameter block passed to _Launch.}
  64. { *************************************************************************}
  65. {}
  66. {* Typedef and flags for launchControlFlags field}
  67.         LaunchFlags = INTEGER;
  68.  
  69.     const
  70.  
  71. {************************************************************************}
  72. { *        Definition of the parameter block passed to _Launch.}
  73. { ************************************************************************}
  74.  
  75.         launchContinue = $4000;
  76.         launchNoFileFlags = $0800;
  77.         launchUseMinimum = $0400;
  78.         launchDontSwitch = $0200;
  79.         launchAllow24Bit = $0100;
  80.         launchInhibitDaemon = $0080;
  81.  
  82.     type
  83. { Format for first AppleEvent to pass to new process.  The size of the overall}
  84. { * buffer variable: the message body immediately follows the messageLength.}
  85. {}
  86.         AppParametersPtr = ^AppParameters;
  87.         AppParameters = record
  88.                 theMsgEvent: EventRecord;
  89.                 eventRefCon: LONGINT;
  90.                 messageLength: LONGINT;
  91.                 messageBuffer: array[0..0] of SignedByte;
  92.             end;
  93.  
  94. { Parameter block to _Launch }
  95.         LaunchPBPtr = ^LaunchParamBlockRec;
  96.         LaunchParamBlockRec = record
  97.                 reserved1: LONGINT;
  98.                 reserved2: INTEGER;
  99.                 launchBlockID: INTEGER;
  100.                 launchEPBLength: LONGINT;
  101.                 launchFileFlags: INTEGER;
  102.                 launchControlFlags: LaunchFlags;
  103.                 launchAppSpec: FSSpecPtr;
  104.                 launchProcessSN: ProcessSerialNumber;
  105.                 launchPreferredSize: LONGINT;
  106.                 launchMinimumSize: LONGINT;
  107.                 launchAvailableSize: LONGINT;
  108.                 launchAppParameters: AppParametersPtr;
  109.             end;
  110.  
  111.  
  112.     const
  113.         extendedBlock = $4C43;  { 'LC' }
  114.         extendedBlockLen = (sizeof(LaunchParamBlockRec) - 12);
  115.  
  116. {************************************************************************}
  117. { * Definition of the information block returned by GetProcessInformation}
  118. { ************************************************************************}
  119. { Bits in the processMode field}
  120.  
  121.         modeDeskAccessory = $00020000;
  122.         modeMultiLaunch = $00010000;
  123.         modeNeedSuspendResume = $00004000;
  124.         modeCanBackground = $00001000;
  125.         modeDoesActivateOnFGSwitch = $00000800;
  126.         modeOnlyBackground = $00000400;
  127.         modeGetFrontClicks = $00000200;
  128.         modeGetAppDiedMsg = $00000100;
  129.         mode32BitCompatible = $00000080;
  130.         modeHighLevelEventAware = $00000040;
  131.         modeLocalAndRemoteHLEvents = $00000020;
  132.         modeStationeryAware = $00000010;
  133.         modeUseTextEditServices = $00000008;
  134.  
  135.     type
  136. { Record returned by GetProcessInformation }
  137.         ProcessInfoRecPtr = ^ProcessInfoRec;
  138.         ProcessInfoRec = record
  139.                 processInfoLength: LONGINT;
  140.                 processName: StringPtr;
  141.                 processNumber: ProcessSerialNumber;
  142.                 processType: LONGINT;
  143.                 processSignature: OSType;
  144.                 processMode: LONGINT;
  145.                 processLocation: Ptr;
  146.                 processSize: LONGINT;
  147.                 processFreeMem: LONGINT;
  148.                 processLauncher: ProcessSerialNumber;
  149.                 processLaunchDate: LONGINT;
  150.                 processActiveTime: LONGINT;
  151.                 processAppSpec: FSSpecPtr;
  152.             end;
  153.  
  154.  
  155.     function LaunchApplication (LaunchParams: LaunchPBPtr): OSErr;
  156.     inline
  157.         $205F, $A9F2, $3E80;
  158.     function LaunchDeskAccessory (pFileSpec: FSSpecPtr; pDAName: StringPtr): OSErr;
  159.     inline
  160.         $3F3C, $0036, $A88F;
  161.     function GetCurrentProcess (var PSN: ProcessSerialNumber): OSErr;
  162.     inline
  163.         $3F3C, $0037, $A88F;
  164.     function GetFrontProcess (var PSN: ProcessSerialNumber): OSErr;
  165.     inline
  166.         $70FF, $2F00, $3F3C, $0039, $A88F;
  167.     function GetNextProcess (var PSN: ProcessSerialNumber): OSErr;
  168.     inline
  169.         $3F3C, $0038, $A88F;
  170.     function GetProcessInformation (PSN: ProcessSerialNumber; var info: ProcessInfoRec): OSErr;
  171.     inline
  172.         $3F3C, $003A, $A88F;
  173.     function SetFrontProcess (PSN: ProcessSerialNumber): OSErr;
  174.     inline
  175.         $3F3C, $003B, $A88F;
  176.     function WakeUpProcess (PSN: ProcessSerialNumber): OSErr;
  177.     inline
  178.         $3F3C, $003C, $A88F;
  179.     function SameProcess (PSN1: ProcessSerialNumber; PSN2: ProcessSerialNumber; var result: BOOLEAN): OSErr;
  180.     inline
  181.         $3F3C, $003D, $A88F;
  182.  
  183.  
  184.     { UsingProcesses }
  185.  
  186.  
  187. implementation
  188. end.
  189.  
  190.